package com.bwie.controller;

import com.bwie.common.domain.Home;
import com.bwie.common.result.Result;
import com.bwie.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @className: HomeController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 李明
 * @date: 2025/10/22 13:04
 */
@RestController
@RequestMapping("home")
@CrossOrigin
public class HomeController {

    @Autowired
    private HomeService homeService;

    /**
     * 菜单树
     * @return
     */
    @GetMapping("homeList/{userId}")
    public Result<List<Home>> homeList(@PathVariable("userId") Integer userId){
        List<Home> homeList = homeService.homeList(userId);
        return Result.error(homeList);
    }

}
